<%@page language="java" isELIgnored="false" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<jsp:directive.include file="/WEB-INF/sitemesh-decorators/include.jsp"/>
<fmt:setBundle basename="bundles.facultyresearch-resources"/>
<html>
<head>
<title>Edit <fmt:message key="facultyresearch.title"/> <fmt:message key="researchkeyword.title"/></title>
<script type="text/javascript">
/* var tempStr2="";
$(function() {
	var categoryList = '${reesearchkeywordList}';
	var catStr = categoryList.substring(categoryList.indexOf('{')+1,categoryList.indexOf('}'));
	catStr = catStr.replace(/=/g,":");
	//alert(catStr);
	var categoryArr=catStr.split(',');
	var tempArray = new Array();
	var tempStr="";
	for(var i=0;i<categoryArr.length;i++){
		tempStr = categoryArr[i];
		tempStr = tempStr.substring(tempStr.indexOf(":")+1);
		//alert(tempStr);
		tempArray[i]= tempStr;
	}
	var tempStr1="";
	
	
	$( "#researchkeyword_keyword").autocomplete({
		//source: categoryArr,
		source: tempArray,
		//define select handler
		select: function(e, ui) {
			//create formatted data
			var cat = ui.item.value;
			getId(cat,categoryArr);
			
			$("#researchkeyword_keyword").val(cat);
		},
		close: function(event, ui) {
			
			
		}
	});
	
});
//if(tempStr2=="")
//	$("#category_categoryId").val(tempStr2);
	
function getId(str,arr){
	var key = "";
	var value ="";
	var tempStr="";
	for(var i=0;i<arr.length;i++){
		tempStr = arr[i];
		key=tempStr.substring(0,tempStr.indexOf(":"));
		value = tempStr.substring(tempStr.indexOf(":")+1);
		if(value==str){
			//alert(key);
			$("#researchkeyword_researchKeywordId").val(key);
		}
	}
} */	
</script>
</head>
<body>
<div id="contentarea">      
	<div id="lb"><div id="rb"><div id="bb"><div id="blc">
	<div id="brc"><div id="tb"><div id="tlc"><div id="trc">
	<div id="content">
		<h1><fmt:message key="navigation.edit"/> <fmt:message key="researchkeyword.title"/></h1>
		<div class="navitem"><a class="button" href="${pageContext.request.contextPath}/selectFacultyresearch?facultyResearchIdKey=${facultyresearch_facultyResearchId}&"><span><img src="includes/images/icons/back.gif" /><fmt:message key="navigation.back"/></span></a></div>
		<form:form action="${pageContext.request.contextPath}/saveFacultyresearchResearchkeywords" method="POST" modelAttribute="researchkeyword">
			<form:hidden id="researchkeyword_researchKeywordId" path="researchKeywordId"/>
			<table cellpadding="0" cellspacing="0" id="viewTable">
				<tbody>
									
					<tr>
						<td class="label" valign="top">
							<fmt:message key="researchkeyword.keyword.title"/>:
						</td>
						<td>
							<form:input id="researchkeyword_keyword" path="keyword" cssStyle="width:300px;"/>
							<!-- <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : "researchkeyword_keyword",widgetType : "dijit.form.ValidationTextBox",widgetAttrs : {promptMessage: "<fmt:message key="researchkeyword.keyword.help"/>"}})); </script> -->
						</td>
					</tr>
				</tbody>
			</table>
			<span class="inputbutton"><input class="savebutton" id="save" type="submit" value="<fmt:message key="navigation.save"/>"/></span>
			<script type="text/javascript">Spring.addDecoration(new Spring.ValidateAllDecoration({elementId:'save', event:'onclick'}));</script>
				<input type="hidden" name="facultyresearch_facultyResearchId" value="${facultyresearch_facultyResearchId}" >
				
				
				
				
		</form:form>
		<div class="clear">&nbsp;</div>
	</div>
	</div></div></div></div>
	</div></div></div></div>
</div>
</body>
</html>
